//
//  NetworkClient.h
//  StoreManagement
//
//  Created by centling on 16/5/14.
//  Copyright © 2016年 alfred. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <AFNetworking.h>

typedef NS_ENUM(NSInteger, RequestMethodType){
    RequestMethodTypePost = 1,
    RequestMethodTypeGet = 2,
    RequestMethodTypeDelete
};

@interface NetworkClient : NSObject

+ (AFHTTPSessionManager*)sharedHTTPSessionManager;
+ (void) cancelTasks;
+ (void)requestWihtMethod:(RequestMethodType)methodType
                      url:(NSString*)url
                   params:(NSDictionary*)params
                  success:(void (^)(id response))success
                  failure:(void (^)(NSError* err))failure;

//added by Alfred
+ (void)requestWithUrl:(NSString*)url
                params:(NSDictionary*)params
              filePath:(NSData *)filePath
          fileParamKey:(NSString *)fileParamKey
               success:(void (^)(id response))success
               failure:(void (^)(NSError* err))failure;

//used to send form-data
+ (void)requestWithUrl:(NSString*)url
                params:(NSDictionary*)params
               success:(void (^)(id response))success
               failure:(void (^)(NSError* err))failure;

@end
